<?php
/**
 * Created by PhpStorm.
 * User: chenzhenlin
 * Date: 2019/3/26
 * Time: 12:27 AM
 */

namespace app\common\controller;


use app\common\helpers\Functions;
use think\App;

class AdminBase extends Base
{
    protected $adminUser = null;
    public function __construct(App $app = null)
    {
        parent::__construct($app);
        // 验证登录
        $this->isLogin();
        $this->adminUser = session('admin_user');
        $this->assign('admin_user', $this->adminUser);
        $this->assign('admin_menu',config('app.menu'));
    }

    public function isLogin(){
        if( !Functions::isLogin() ){
          $this->redirect('/admin/login');
        }
    }
}